home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 124
/
MOBICLIC 124.ISO
/
mac
/
Milan.swf
/
scripts
/
__Packages
/
prod
/
hclasses
/
HOTE_MC.as
< prev
Wrap
Text File
|
2010-05-11
|
33KB
|
863 lines
class prod.hclasses.HOTE_MC extends MovieClip
{
var ModeFenetre = "fullScreen";
function HOTE_MC()
{
super();
trace("HOTE constructeur " + this);
_global.ChangeModule = mx.utils.Delegate.create(this,this.ChangeModule);
_global.ImprimerEcran = mx.utils.Delegate.create(this,this.ImprimerEcran);
_global.chercheSwf = _global.ChangeModule;
this.tabChildren = false;
this.Init();
}
static function main(target)
{
target.__proto__ = prod.hclasses.HOTE_MC.prototype;
Function(prod.hclasses.HOTE_MC).apply(target,null);
}
function Init()
{
trace("HOTE.Init()");
Stage.showMenu = false;
var _loc2_ = new Object();
_loc2_.onFullScreen = function(bFull)
{
HOTE.ModeFenetre = Stage.displayState;
};
Stage.addListener(_loc2_);
this.FullScreenSet(true);
trace("localConfigXML " + localConfigXML);
if(localConfigXML == undefined)
{
localConfigXML = "localConfig.xml";
}
prod.hclasses.HOTE_MC.ChargerXmlFichier({mcRef:this,fonction:this.RetourLocalConfig,fichier:localConfigXML});
}
function RetourLocalConfig(p)
{
trace("RetourLocalConfig() ");
_root.GetLocalConfig({Path:"Config",XmlObj:p.XmlObj});
_root.LocalConfig.Set({nom:"path",defaut:"DATA/"});
_root.LocalConfig.Set({nom:"pad_path",defaut:"DATA/PAD/PAD/Pad.swf"});
_root.LocalConfig.Set({nom:"quality",defaut:"STANDART"});
_root.LocalConfig.Set({nom:"hote_couleur_fond",defaut:0,type:"number"});
this.QualitySet(_root.LocalConfig.quality);
_root.LocalConfig.traceMode = _root.LocalConfig.traceMode != "on" ? (_root.LocalConfig.traceMode = "off") : (_root.LocalConfig.traceMode = "on");
_root.LocalConfig.pad_show = _root.LocalConfig.pad_show != "no" ? true : false;
_root.LocalConfig.preload_bar_visible = _root.LocalConfig.preload_bar_visible != "no" ? true : false;
_root.LocalConfig.preload_movie_visible = _root.LocalConfig.preload_movie_visible != "no" ? true : false;
if(_root.LocalConfig.traceBox != "on")
{
delete _global.TraceBox;
}
xtrace_ChangeMode(_root.LocalConfig.traceMode);
xtrace_raz();
trace("xtrace " + xtrace_mode);
_global.gListXMLpath = new Array();
_global.gListXMLpath[_root.LocalConfig.nextRub] = this.codeRub_To_XmlPath({numMag:_root.LocalConfig.numMag,codeRub:_root.LocalConfig.nextRub,numMod:_root.LocalConfig.numMod,path:_root.LocalConfig.path});
_global.HOTE = this;
_global.gPARAMS = [];
gPARAMS.HOTE_DIR = this.GetFilePath(this._url);
gPARAMS.MEDIAS_DIR = gPARAMS.HOTE_DIR + "/DATA/HOTE/medias";
gPARAMS.CURSEURS_DIR = gPARAMS.MEDIAS_DIR + "/curseur";
gPARAMS.CURSEUR_DEFAUT = gPARAMS.CURSEURS_DIR + "/curseur.swf";
gPARAMS.PRELOADERS_DIR = gPARAMS.MEDIAS_DIR + "/chargement_animation";
gPARAMS.PRELOADER_DEFAUT = gPARAMS.PRELOADERS_DIR + "/preloader_defaut.swf";
gPARAMS.BARRES_DIR = gPARAMS.MEDIAS_DIR + "/chargement_barre";
gPARAMS.BARRE_DEFAUT = gPARAMS.BARRES_DIR + "/barre.swf";
gPARAMS.HOTE_WIDTH = 800;
gPARAMS.HOTE_HEIGHT = 600;
gPARAMS.HOTE_FOND_COULEUR = _root.LocalConfig.hote_couleur_fond;
_global.PREMIER_MODULE = 0;
_global.gLEVELS = [];
gLEVELS.HOTE_FOND = 1;
gLEVELS.HOTE_CONTENEUR = 10;
gLEVELS.HOTE_CACHE = 25000;
gLEVELS.ClicZap = 26000;
gLEVELS.TraceBoxAlerte = 40000;
gLEVELS.preload_bar = 22000;
gLEVELS.preload_movie = 20000;
gLEVELS.cursor = 30000;
gLEVELS.module = 10000;
gLEVELS.tetiere = 10010;
gLEVELS.pad = 23000;
_global.MCs = [];
_global.gListeVuMod = [0,0,0];
PREMIER_MODULE = _root.LocalConfig.nextRub;
_global.gNO_MODULE_EN_COURS = PREMIER_MODULE;
prod.hclasses.HOTE_MC.ChargerXmlFichier({mcRef:this,fichier:gListXMLpath[gNO_MODULE_EN_COURS],fonction:this.RetourXml});
}
function GetLocalConfig(p)
{
trace("GetLocalConfig()");
_root.LocalConfig = new Object();
_root.LocalConfig.Set = function(p)
{
if(_root.LocalConfig[p.nom] == undefined)
{
if(p.defaut == "OBLIGATOIRE")
{
xtrace({mess:"/!\\ERROR /!\\Paramètre du xml obligatoire manquant dans la balise Config: " + p.nom,group:"error"});
}
else
{
_root.LocalConfig[p.nom] = p.defaut;
}
}
if(p.type == "number")
{
_root.LocalConfig[p.nom] = Number(_root.LocalConfig[p.nom]);
}
};
_root.LocalConfig._name = "LocalConfig";
var _loc2_ = _root.returnNodeByPath(p.Path,p.XmlObj).childNodes;
for(props in _loc2_)
{
_root.LocalConfig[_loc2_[props].attributes.nom] = _loc2_[props].attributes.valeur;
}
}
function RetourXml(par)
{
var _loc4_ = this.NodeAttributesToObject(this.returnNodeByPath("Module.Config.Hote",par.XmlObj));
var _loc5_ = this.NodeAttributesToObject(this.returnNodeByPath("BackOffice.ModuleInfo",par.XmlObj));
for(props in _loc4_)
{
_loc5_[props] = _loc4_[props];
}
_global.gMODULE_INFO = _loc5_;
if(gMODULE_INFO.module_path == undefined)
{
if(gListSWFpath[gNO_MODULE_EN_COURS] == undefined)
{
gMODULE_INFO.module_path = this.GetFilePath(gListXMLpath[gNO_MODULE_EN_COURS]) + "/" + gMODULE_INFO.src;
}
else
{
gMODULE_INFO.module_path = gListSWFpath[gNO_MODULE_EN_COURS];
}
}
gMODULE_INFO.module_dir = this.GetFilePath(gMODULE_INFO.module_path);
gMODULE_INFO.module_adjust_size = gMODULE_INFO.module_adjust_size != undefined ? gMODULE_INFO.module_adjust_size : "yes";
gMODULE_INFO.module_adjust_size = gMODULE_INFO.module_adjust_size != "yes" ? false : true;
gMODULE_INFO.module_width = gMODULE_INFO.module_width != undefined ? gMODULE_INFO.module_width : gMODULE_INFO.width;
gMODULE_INFO.module_height = gMODULE_INFO.module_height != undefined ? gMODULE_INFO.module_height : gMODULE_INFO.height;
gMODULE_INFO.preload_bar_width = gMODULE_INFO.preload_bar_width != undefined ? gMODULE_INFO.preload_bar_width : 800;
gMODULE_INFO.preload_bar_height = gMODULE_INFO.preload_bar_height != undefined ? gMODULE_INFO.preload_bar_height : 600;
if(gMODULE_INFO.preload_bar_visible == undefined)
{
gMODULE_INFO.preload_bar_visible = _root.LocalConfig.preload_bar_visible;
}
else
{
gMODULE_INFO.preload_bar_visible = gMODULE_INFO.preload_bar_visible != "no" ? true : false;
}
if(gMODULE_INFO.preload_bar_path == undefined)
{
gMODULE_INFO.preload_bar_path = gPARAMS.BARRE_DEFAUT;
}
else
{
var _loc6_ = gMODULE_INFO.preload_bar_path.split("/");
switch(_loc6_[0])
{
case "DEFAUT":
gMODULE_INFO.preload_bar_path = gPARAMS.BARRES_DIR + "/" + _loc6_.slice(1).join("/");
break;
case "MODULE":
gMODULE_INFO.preload_bar_path = gMODULE_INFO.module_dir + "/" + _loc6_.slice(1).join("/");
break;
case "MODULE_C":
gMODULE_INFO.preload_bar_path = gMODULE_INFO.module_dir + "/C_" + gMODULE_INFO.id + "/" + _loc6_.slice(1).join("/");
break;
case "MEDIAS":
gMODULE_INFO.preload_bar_path = gPARAMS.MEDIAS_DIR + "/" + _loc6_.slice(1).join("/");
}
}
if(gMODULE_INFO.preload_movie_path == undefined)
{
gMODULE_INFO.preload_movie_path = gPARAMS.PRELOADER_DEFAUT;
}
else
{
_loc6_ = gMODULE_INFO.preload_movie_path.split("/");
switch(_loc6_[0])
{
case "DEFAUT":
gMODULE_INFO.preload_movie_path = gPARAMS.PRELOADERS_DIR + "/" + _loc6_.slice(1).join("/");
break;
case "MODULE":
gMODULE_INFO.preload_movie_path = gMODULE_INFO.module_dir + "/" + _loc6_.slice(1).join("/");
break;
case "MODULE_C":
gMODULE_INFO.preload_movie_path = gMODULE_INFO.module_dir + "/C_" + gMODULE_INFO.id + "/" + _loc6_.slice(1).join("/");
break;
case "MEDIAS":
gMODULE_INFO.preload_movie_path = gPARAMS.MEDIAS_DIR + "/" + _loc6_.slice(1).join("/");
}
}
gMODULE_INFO.preload_movie_width = gMODULE_INFO.preload_movie_width != undefined ? gMODULE_INFO.preload_movie_width : 800;
gMODULE_INFO.preload_movie_height = gMODULE_INFO.preload_movie_height != undefined ? gMODULE_INFO.preload_movie_height : 600;
if(gMODULE_INFO.preload_movie_visible == undefined)
{
gMODULE_INFO.preload_movie_visible = _root.LocalConfig.preload_movie_visible;
}
else
{
gMODULE_INFO.preload_movie_visible = gMODULE_INFO.preload_movie_visible != "no" ? true : false;
}
gMODULE_INFO.preload_movie_choose_random = gMODULE_INFO.preload_movie_choose_random != "yes" ? false : true;
gMODULE_INFO.preload_movie_wait_end = gMODULE_INFO.preload_movie_wait_end != "yes" ? false : true;
gMODULE_INFO.preload_movie_wait_time = gMODULE_INFO.preload_movie_wait_time != undefined ? Number(gMODULE_INFO.preload_movie_wait_time) : 0;
gMODULE_INFO.preload_bar_button_quit = gMODULE_INFO.preload_bar_button_quit != "yes" ? false : true;
gMODULE_INFO.preload_ratio = gMODULE_INFO.preload_ratio != undefined ? Number(gMODULE_INFO.preload_ratio) : 70;
trace("RETOURXML pad " + gMODULE_INFO.pad_show);
if(gMODULE_INFO.pad_show == undefined)
{
gMODULE_INFO.pad_show = _root.LocalConfig.pad_show;
}
else
{
gMODULE_INFO.pad_show = gMODULE_INFO.pad_show != "no" ? true : false;
}
if(gMODULE_INFO.cursor_path == undefined)
{
gMODULE_INFO.cursor_path = gPARAMS.CURSEUR_DEFAUT;
gMODULE_INFO.cursor_use_flash_arrow = gMODULE_INFO.cursor_use_flash_arrow != "no" ? true : false;
gMODULE_INFO.cursor_use_flash_finger = gMODULE_INFO.cursor_use_flash_finger != "no" ? true : false;
}
else
{
_loc6_ = gMODULE_INFO.cursor_path.split("/");
switch(_loc6_[0])
{
case "DEFAUT":
gMODULE_INFO.cursor_path = gPARAMS.CURSEURS_DIR + "/" + _loc6_.slice(1).join("/");
break;
case "MODULE":
gMODULE_INFO.cursor_path = gMODULE_INFO.module_dir + "/" + _loc6_.slice(1).join("/");
break;
case "MODULE_C":
gMODULE_INFO.cursor_path = gMODULE_INFO.module_dir + "/C_" + gMODULE_INFO.id + "/" + _loc6_.slice(1).join("/");
break;
case "MEDIAS":
gMODULE_INFO.cursor_path = gPARAMS.MEDIAS_DIR + "/" + _loc6_.slice(1).join("/");
}
gMODULE_INFO.cursor_use_flash_arrow = gMODULE_INFO.cursor_use_flash_arrow != "yes" ? false : true;
gMODULE_INFO.cursor_use_flash_finger = gMODULE_INFO.cursor_use_flash_finger != "yes" ? false : true;
}
_global.moduleOnline = true;
_global.gModulePath = gListSRCpath[gNO_MODULE_EN_COURS] != undefined ? gListSRCpath[gNO_MODULE_EN_COURS] : gMODULE_INFO.module_dir + "/";
_global.gDataPath = _root.LocalConfig.path;
_global.gRootPath = gPARAMS.HOTE_DIR;
_global.moduleXmlRoot = gListXMLpath[gNO_MODULE_EN_COURS];
_global.MODULE_INFO = gMODULE_INFO;
xtrace("________MODULE INFO____________________");
xlisteObj(gMODULE_INFO);
xtrace("_______________________________________");
_global.HOTE.CONTENEUR = HOTE.createEmptyMovieClip("CONTENEUR",gLEVELS.HOTE_CONTENEUR);
var _loc16_ = 1;
if(_global.gMODULE_INFO.module_adjust_size == true)
{
_global.HOTE.CONTENEUR._xscale = gMODULE_INFO.module_width * 100 / gPARAMS.HOTE_WIDTH;
_global.HOTE.CONTENEUR._yscale = gMODULE_INFO.module_height * 100 / gPARAMS.HOTE_HEIGHT;
_global.HOTE.CONTENEUR._x = gPARAMS.HOTE_WIDTH / 2 - gMODULE_INFO.module_width / 2;
_global.HOTE.CONTENEUR._y = gPARAMS.HOTE_HEIGHT / 2 - gMODULE_INFO.module_height / 2;
this.CreerCache({nom:"HOTE_CACHE",mc:HOTE.CONTENEUR,level:gLEVELS.HOTE_CACHE,width:gPARAMS.HOTE_WIDTH,height:gPARAMS.HOTE_HEIGHT});
HOTE.CONTENEUR._visible = true;
this.CreerRectangle({pere:this,nom:"FOND_HOTE",level:_global.gLEVELS.HOTE_FOND,couleur:_global.gPARAMS.HOTE_FOND_COULEUR,alpha:100,width:_global.gPARAMS.HOTE_WIDTH,height:_global.gPARAMS.HOTE_HEIGHT});
}
if(gMODULE_INFO.pad_show == true)
{
this.AddMC({nom_mc:"pad",pere:HOTE.CONTENEUR,mc_path:_root.LocalConfig.pad_path,level:gLEVELS.pad});
}
this.AddMC({nom_mc:"preload_movie",pere:HOTE.CONTENEUR,mc_path:gMODULE_INFO.preload_movie_path,level:gLEVELS.preload_movie});
this.AddMC({nom_mc:"preload_bar",pere:HOTE.CONTENEUR,mc_path:gMODULE_INFO.preload_bar_path,level:gLEVELS.preload_bar});
if(gPARAMS.Rubriques[_global.gNO_MODULE_EN_COURS].logo != undefined)
{
this.AddMC({nom_mc:"tetiere",pere:HOTE.CONTENEUR,mc_path:_root.LocalConfig.path + "LOGOS/TETIERES/tetiere_" + gPARAMS.Rubriques[_global.gNO_MODULE_EN_COURS].logo + ".swf",level:gLEVELS.tetiere});
}
this.AddMC({nom_mc:"cursor",pere:HOTE,mc_path:gMODULE_INFO.cursor_path,level:gLEVELS.cursor});
this.ChargerMCs();
}
function AddMC(p)
{
MCs[p.nom_mc] = p;
MCs[p.nom_mc].charge = 0;
MCs[p.nom_mc].ratio = MCs[p.nom_mc].ratio != undefined ? MCs[p.nom_mc].ratio : 100;
}
function ChargerMCs()
{
trace("ChargerMCs");
for(prop in _global.MCs)
{
if(_global.MCs[prop].charge == 0)
{
this.ChargerMC(MCs[prop]);
}
}
}
function ChargerMC(p)
{
xtrace("___ChargerMC___");
_global.xlisteObj(p);
xtrace("________________");
this.removeMovieClip();
var _loc5_ = p.pere.createEmptyMovieClip(p.nom_mc,p.level);
_loc5_._visible = false;
var _loc4_ = new MovieClipLoader();
_loc4_.p = p;
_loc4_.onLoadStart = function(target_mc)
{
trace("onLoadStart " + target_mc);
target_mc._visible = false;
};
_loc4_.onLoadError = function(target_mc)
{
trace("onLoadError " + target_mc);
_global.TraceBox.Alerte("/!\\ ERREUR /!\\\r problème avec le chargement du fichier SWF : \r" + this.p.mc_path);
};
_loc4_.onLoadProgress = function(target_mc, bytesLoaded, bytesTotal)
{
if(this.p.nom_mc == "module")
{
_global.HOTE.LoadingProgress(Math.round(bytesLoaded / bytesTotal * 100 * (this.p.ratio / 100)));
}
target_mc._visible = false;
};
_loc4_.onLoadInit = function(target_mc)
{
trace("onLoadInit " + target_mc);
_global.xtrace_ChangeMode(_root.LocalConfig.traceMode);
xtrace("YOOOOOOO");
target_mc.p = this.p;
trace(target_mc._name + ".Init() :" + target_mc.Init);
if(target_mc.Init == undefined)
{
target_mc.Init = function()
{
HOTE.InitFin(target_mc);
};
}
target_mc.Init();
};
_loc4_.loadClip(p.mc_path,_loc5_);
}
function LoadingProgress(pourcent)
{
_global.MCs.preload_bar.mc.onLoading(pourcent);
_global.MCs.preload_movie.mc.BARRE_CHARGEMENT.gotoAndStop(pourcent);
}
function InitFin(mc)
{
trace("INITFIN " + mc);
_global.MCs[mc._name].charge = 1;
_global.MCs[mc._name].mc = mc;
if(mc.p.retour != undefined)
{
mc.p.retour.call(HOTE,{mc:mc});
return undefined;
}
var _loc3_ = true;
for(prop in _global.MCs)
{
if(_global.MCs[prop].charge == 0)
{
_loc3_ = false;
break;
}
}
if(_loc3_ == false)
{
return undefined;
}
this.ToutFini();
}
function ToutFini()
{
trace("TOUT_FINI()");
MCs.cursor.mc.__proto__ = prod.hclasses.Curseur.prototype;
MCs.cursor.mc.CurseurFlecheFlash = gMODULE_INFO.cursor_use_flash_arrow;
MCs.cursor.mc.CurseurDoigtFlash = gMODULE_INFO.cursor_use_flash_finger;
MCs.cursor.mc.Initialise();
if(gMODULE_INFO.preload_movie_visible == true)
{
if(MCs.preload_movie.mc.Largeur != undefined)
{
var _loc3_ = Number(MCs.preload_movie.mc.Largeur);
var _loc4_ = Number(MCs.preload_movie.mc.Hauteur);
}
else
{
_loc3_ = Number(gMODULE_INFO.preload_movie_width);
_loc4_ = Number(gMODULE_INFO.preload_movie_height);
}
MCs.preload_movie.mc._xscale = gPARAMS.HOTE_WIDTH * 100 / _loc3_;
MCs.preload_movie.mc._yscale = gPARAMS.HOTE_HEIGHT * 100 / _loc4_;
if(gMODULE_INFO.preload_movie_choose_random == true)
{
var _loc2_ = "L_" + this.gimme2digits(this.randomValue(1,MCs.preload_movie.mc.NombreAnimations));
}
else
{
_loc2_ = 2;
}
MCs.preload_movie.mc.gotoAndPlay(_loc2_);
MCs.preload_movie.mc._visible = true;
}
trace("gMODULE_INFO[\'preload_bar_visible\']__________________________________" + gMODULE_INFO.preload_bar_visible);
if(gMODULE_INFO.preload_bar_visible == true)
{
if(MCs.preload_bar.mc.Largeur != undefined)
{
_loc3_ = Number(MCs.preload_bar.mc.Largeur);
_loc4_ = Number(MCs.preload_bar.mc.Hauteur);
}
else
{
_loc3_ = Number(gMODULE_INFO.preload_bar_width);
_loc4_ = Number(gMODULE_INFO.preload_bar_height);
}
MCs.preload_bar.mc._xscale = gPARAMS.HOTE_WIDTH * 100 / _loc3_;
MCs.preload_bar.mc._yscale = gPARAMS.HOTE_HEIGHT * 100 / _loc4_;
MCs.preload_bar.mc._visible = gMODULE_INFO.preload_bar_visible;
}
this.AddMC({nom_mc:"module",ratio:gMODULE_INFO.preload_ratio,pere:HOTE.CONTENEUR,mc_path:gMODULE_INFO.module_path,level:gLEVELS.module,retour:this.ModuleFin,AdjustSize:true});
this.ChargerMCs();
}
function ModuleFin(p)
{
trace("MODULEFIN() " + p.mc);
_global.gMODULE_INFO.MODULE_MC = p.mc;
_global.gMODULE_INFO.PARAMS_EMETTEUR = gPARAMS_MODULE_EMETTEUR;
_global.xtrace_ChangeMode(_root.LocalConfig.traceMode);
var _loc4_ = Number(_global.gMODULE_INFO.module_width);
var _loc5_ = Number(_global.gMODULE_INFO.module_height);
if(_global.gMODULE_INFO.module_adjust_size == true)
{
p.mc._xscale = gPARAMS.HOTE_WIDTH * 100 / _loc4_;
p.mc._yscale = gPARAMS.HOTE_HEIGHT * 100 / _loc5_;
}
else
{
p.mc._xscale = gPARAMS.HOTE_WIDTH * 100 / _loc4_;
p.mc._yscale = gPARAMS.HOTE_HEIGHT * 100 / _loc5_;
}
_global.HOTE.LoadingProgress(100);
}
function quit()
{
xtrace("QUIT()");
if(gMODULE_INFO.preload_movie_wait_time != 0)
{
xtrace("attente de " + gMODULE_INFO.preload_movie_wait_time + " secondes avant lancement");
this.WaitTimeFunc = function()
{
xtrace("fin attente");
clearInterval(this.WAIT_TIME_ID);
gMODULE_INFO.preload_movie_wait_time = 0;
this.quit();
};
this.WAIT_TIME_ID = setInterval(this,"WaitTimeFunc",gMODULE_INFO.preload_movie_wait_time * 1000);
return undefined;
}
if(gMODULE_INFO.preload_movie_wait_end == true)
{
this.RequeteFin = function(mc_preloader)
{
gMODULE_INFO.preload_movie_wait_end = false;
this.quit();
};
return undefined;
}
this.QualitySet(this.QUALITY);
MCs.preload_movie.mc._visible = false;
MCs.preload_bar.mc._visible = false;
MCs.preload_movie.mc.stop();
MCs.preload_bar.mc.stop();
MCs.preload_movie.mc.stopAllSounds();
MCs.preload_bar.mc.stopAllSounds();
MCs.preload_bar.mc.Reset();
this.removeMovieClip();
this.removeMovieClip();
trace("+++++ TETIERE +++ " + MCs.tetiere.mc + " x: " + MCs.tetiere.mc._x + " y: " + MCs.tetiere.mc._y);
MCs.tetiere.mc._xscale *= Number(_root.LocalConfig.TetieresScale);
MCs.tetiere.mc._yscale *= Number(_root.LocalConfig.TetieresScale);
if(_root.LocalConfig.TetieresBottomAlign == "y")
{
MCs.tetiere.mc._y = Number(_root.LocalConfig.TetieresPosY) - MCs.tetiere.mc._height;
}
else
{
MCs.tetiere.mc._y = Number(_root.LocalConfig.TetieresPosY);
}
MCs.tetiere.mc._x = Number(_root.LocalConfig.TetieresPosX);
_global.ChangeModule = mx.utils.Delegate.create(this,this.ChangeModule);
MCs.module.mc.ImprimerMC = function(p)
{
p.mc = this;
_global.HOTE.ImprimerMC(p);
};
_global.SousTitresOn = _global.SousTitresOn != undefined ? _global.SousTitresOn : false;
if(_global.SousTitresOn == true)
{
MCs.module.mc.gSousTitre = 1;
MCs.module.mc.gST = 1;
}
else
{
MCs.module.mc.gSousTitre = 0;
MCs.module.mc.gST = 0;
}
if(_root.LocalConfig.VolumeGeneral != undefined)
{
trace("_root.LocalConfig[\"VolumeGeneral\"] : " + _root.LocalConfig.VolumeGeneral);
MCs.module.mc.gVolume = Number(_root.LocalConfig.VolumeGeneral);
}
_global.ModuleMusicOn = _global.ModuleMusicOn != undefined ? _global.ModuleMusicOn : true;
if(_global.ModuleMusicOn == true)
{
MCs.module.mc.changeMusicOn(1);
}
else
{
MCs.module.mc.changeMusicOn(0);
}
trace("PAD" + gMODULE_INFO.pad_show);
if(gMODULE_INFO.pad_show == true)
{
MCs.pad.mc._visible = true;
}
else
{
MCs.pad.mc._visible = false;
}
MENU._visible = true;
MCs.module.mc._visible = true;
MCs.tetiere.mc._visible = true;
if(_global.gMODULE_INFO.PARAMS_EMETTEUR.A_GoLabel == undefined)
{
xtrace("lancement du module par sa fonction Start()");
MCs.module.mc.Start();
}
else
{
xtrace("lancement du module ? la frame " + _global.gMODULE_INFO.PARAMS_EMETTEUR.A_GoLabel);
MCs.module.mc.gotoAndPlay(_global.gMODULE_INFO.PARAMS_EMETTEUR.A_GoLabel);
}
xtrace("_________________________________");
xtrace("Fin d\'initialisation par l\'Hote.");
xtrace("La main est au module");
xtrace("_________________________________");
xtrace("");
}
function ChangeModule(p)
{
trace("ChangeModule " + this);
xlisteObj(p);
var _loc7_ = typeof p != "object" ? p : p.numMod;
var _loc4_ = _global.MCs.module.mc;
if(_loc4_ !== undefined)
{
p.FROM = {};
p.FROM.Type = "module";
p.FROM.No = _loc4_.gModuleNumber;
p.FROM.Name = _loc4_.gModuleName;
p.FROM.Rub = _loc4_.gModuleName.splice(0,3);
_loc4_.StopAll();
_loc4_._visible = false;
_loc4_.stop();
_loc4_.changeMusicOn(0);
if(_loc4_.gCommentOn !== undefined)
{
trace("comment detect?");
stopComment();
}
if(_loc4_.gListeBruitage !== undefined)
{
i = 0;
while(i < _loc4_.gListeBruitage.length)
{
_loc4_.soundObjects[_loc4_.gBruitageName + _loc4_.gListeBruitage[i]].stop();
i++;
}
}
_loc4_.soundObjects[_loc4_.gMusic].stop();
CURSEUR.Action("fleche");
}
_global.gListXMLpath[p.codeRub] = this.codeRub_To_XmlPath({numMag:_root.LocalConfig.numMag,codeRub:p.codeRub,numMod:p.numMod,path:_root.LocalConfig.path});
_global.gNO_MODULE_EN_COURS = p.codeRub;
_global.gPARAMS_MODULE_EMETTEUR = p;
prod.hclasses.HOTE_MC.ChargerXmlFichier({mcRef:this,fichier:_global.gListXMLpath[_global.gNO_MODULE_EN_COURS],fonction:this.RetourXml});
}
function ToutStop(mc)
{
mc.stop();
for(cemc in mc)
{
if(typeof mc[cemc] == "movieclip")
{
mc[cemc].stop();
this.ToutStop(mc[cemc]);
}
}
}
function RequeteFin(mc_preloader)
{
}
function Quitter()
{
fscommand("quit");
}
function QualitySet(mode)
{
trace("QualitySet " + mode);
this.QUALITY = mode;
switch(mode)
{
case "BAS":
this._quality = "LOW";
break;
case "MOYEN":
this._quality = "MEDIUM";
break;
case "STANDART":
this._quality = "HIGH";
break;
case "EXCELLENT":
this._quality = "BEST";
}
}
function FullScreen(p)
{
this.FULLSCREEN = this.FULLSCREEN != true ? true : false;
this.FullScreenSet(this.FULLSCREEN);
}
function FullScreenSet(etat)
{
Stage.displayState = "fullScreen";
if(this.ModeFenetre == "normal")
{
etat = !etat;
}
this.FULLSCREEN = etat;
if(etat == false)
{
Stage.scaleMode = "noScale";
}
else
{
Stage.scaleMode = "showAll";
}
this.ModeFenetre = Stage.displayState;
}
function FullScreenOn()
{
this.FullScreenSet(true);
}
function FullScreenOff()
{
this.FullScreenSet(false);
}
static function ChargerXmlFichier(p)
{
trace("ChargerXmlFichier()");
xlisteObj(p);
var XmlObj = new XML();
var params = new Object();
XmlObj.ignoreWhite = true;
XmlObj.onLoad = function(success)
{
if(success)
{
if(p.fonction != undefined)
{
var _loc2_ = p.fonction;
params.XmlObj = XmlObj;
_loc2_.call(p.mcRef,params);
}
}
else
{
_global.TraceBox.Alerte("/!\\ ERREUR /!\\\r problème avec le chargement du fichier XML : \r" + p.fichier);
}
};
XmlObj.load(p.fichier);
}
function codeRub_To_XmlPath(p)
{
var _loc3_ = p.path + p.codeRub + p.numMag + "/" + p.codeRub + p.numMag + "_" + this.gimme2digits(p.numMod) + "/XML_" + p.codeRub + p.numMag + "_" + this.gimme2digits(p.numMod) + ".xml";
return _loc3_;
}
function returnNodeByPath(nodePath, XmlObj)
{
var _loc4_ = nodePath.split(".");
var _loc3_ = XmlObj.firstChild;
var _loc2_ = 0;
while(_loc2_ < _loc4_.length)
{
_loc3_ = this.getbyNodename(_loc4_[_loc2_],_loc3_);
_loc2_ = _loc2_ + 1;
}
return _loc3_;
}
function getbyNodename(nodeName, XMLBlock)
{
var _loc1_ = 0;
while(_loc1_ < XMLBlock.childNodes.length)
{
if(XMLBlock.childNodes[_loc1_].nodeName == nodeName)
{
return XMLBlock.childNodes[_loc1_].cloneNode(true);
}
_loc1_ = _loc1_ + 1;
}
return undefined;
}
function NodeAttributesToObject(Node)
{
var _loc2_ = new Object();
for(props in Node.attributes)
{
_loc2_[props] = Node.attributes[props];
}
return _loc2_;
}
function CreerCache(p)
{
trace("CreerCache");
var _loc1_ = p.mc.createEmptyMovieClip(p.nom,p.level);
_loc1_.beginFill(65280,50);
_loc1_.moveTo(0,0);
_loc1_.lineTo(p.width,0);
_loc1_.lineTo(p.width,p.height);
_loc1_.lineTo(0,p.height);
_loc1_.lineTo(0,0);
_loc1_.endFill();
p.mc.setMask(_loc1_);
return _loc1_;
}
function CreerRectangle(p)
{
var _loc1_ = p.pere.createEmptyMovieClip(p.nom,p.level);
_loc1_.beginFill(p.couleur,p.alpha);
_loc1_.moveTo(0,0);
_loc1_.lineTo(p.width,0);
_loc1_.lineTo(p.width,p.height);
_loc1_.lineTo(0,p.height);
_loc1_.lineTo(0,0);
_loc1_.endFill();
return _loc1_;
}
function gimme2digits(X)
{
if(Number(X) < 10)
{
lX = "0" + Number(X);
}
else
{
lX = String(X);
}
return lX;
}
function GetFilePath(fichier)
{
var _loc3_ = this.AntiSlashToSlash(fichier);
var _loc2_ = _loc3_.split("/");
_loc2_.pop();
return _loc2_.join("/");
}
function AntiSlashToSlash(chaine)
{
return this.str_replace(chaine,"\\","/");
}
function str_replace(str, search, replace)
{
return str.split(search).join(replace);
}
function randomValue(min, max)
{
var _loc1_ = Math.floor(Math.random() * (max - min + 1)) + min;
return _loc1_;
}
function ImprimerEcran(p)
{
var _loc4_ = new PrintJob();
var _loc17_ = 1;
if(p.Pages != undefined)
{
_loc17_ = p.Pages.length;
var _loc6_ = 0;
while(_loc6_ < _loc17_)
{
p.Pages[_loc6_]._visible = false;
_loc6_ = _loc6_ + 1;
}
}
var _loc3_ = this.CONTENEUR;
var _loc30_ = _global.gPARAMS.HOTE_WIDTH;
var _loc31_ = _global.gPARAMS.HOTE_HEIGHT;
if(_loc4_.start())
{
MCs.pad.mc._visible = false;
MCs.tetiere.mc._visible = false;
this.CreerRectangle({pere:this,nom:"FOND_IMPRESSION",level:2,couleur:16777215,alpha:100,width:_global.gPARAMS.HOTE_WIDTH + 50000,height:_global.gPARAMS.HOTE_HEIGHT + 50000});
this.FOND_IMPRESSION._x = -25000;
this.FOND_IMPRESSION._y = -25000;
var _loc23_ = _loc4_.orientation;
p.Pages[0]._parent._visible = true;
_loc6_ = 0;
while(_loc6_ < _loc17_)
{
p.Pages[_loc6_]._visible = true;
var _loc8_ = 100 * (_loc4_.pageHeight / 800);
var _loc7_ = 100 * (_loc4_.pageWidth / 600);
if(_loc8_ >= _loc7_)
{
var _loc5_ = _loc7_;
}
else
{
_loc5_ = _loc8_;
}
var _loc16_ = _loc3_._xscale;
var _loc15_ = _loc3_._yscale;
var _loc13_ = _loc3_._x;
var _loc14_ = _loc3_._y;
var _loc12_ = _loc3_._rotation;
_loc3_._xscale = _loc5_;
_loc3_._yscale = _loc5_;
_loc3_.realW = 800 * _loc5_ / 100;
_loc3_.realH = 600 * _loc5_ / 100;
if(_loc23_ == "portrait")
{
_loc3_._rotation += 90;
}
var _loc9_ = Math.abs((_loc4_.pageWidth - _loc3_.realH) / 2);
var _loc10_ = Math.abs((_loc4_.pageHeight - _loc3_.realW) / 2);
_loc4_.addPage(this,{xMin:- _loc3_.realH - _loc9_,xMax:0 + _loc9_,yMin:- _loc10_,yMax:_loc3_.realW + _loc10_},{printAsBitmap:true});
_loc3_._rotation = _loc12_;
_loc3_._xscale = _loc16_;
_loc3_._yscale = _loc15_;
_loc3_._x = _loc13_;
_loc3_._y = _loc14_;
p.Pages[_loc6_]._visible = false;
_loc6_ = _loc6_ + 1;
}
_loc4_.send();
if(p.Pages[0]._parent != _loc3_)
{
p.Pages[0]._parent._visible = false;
}
this.FOND_IMPRESSION.removeMovieClip();
MCs.pad.mc._visible = true;
MCs.tetiere.mc._visible = true;
false;
return true;
}
false;
return false;
}
}